package com.example.yan_music.model.net;

import com.example.yan_music.bean.UserInfo;
import com.example.yan_music.bean.wangyi.Banner;
import com.example.yan_music.bean.wangyi.Lyric;
import com.example.yan_music.bean.wangyi.NewSearchSong;
import com.example.yan_music.bean.wangyi.NewSongUrl;
import com.example.yan_music.bean.wangyi.RecommendSongList;
import com.example.yan_music.bean.wangyi.SongAlbum;
import com.example.yan_music.bean.wangyi.SongDetail;
import com.example.yan_music.bean.wangyi.SongListDetail;

import java.util.List;

import io.reactivex.Observable;

public class NetworkActionImp implements NetworkAction {

    /**
     * Retrofit网络请求接口实例
     */
    private NetRetrofitService mNetRetrofitService;

    public NetworkActionImp(NetRetrofitService mNetRetrofitService) {
        this.mNetRetrofitService = mNetRetrofitService;
    }

    @Override
    public Observable<UserInfo> login(String phoneNum, String password) {
        return mNetRetrofitService.login(phoneNum, password);
    }

    @Override
    public Observable<NewSearchSong> search(String keywords, int offset) {
        return mNetRetrofitService.search(keywords, offset);
    }

    @Override
    public Observable<NewSongUrl> getSongPlayUrl(int songId) {
        return mNetRetrofitService.getSongPlayUrl(songId);
    }

    @Override
    public Observable<Lyric> getSongLyric(int songId) {
        return mNetRetrofitService.getSongLyric(songId);
    }

    @Override
    public Observable<SongAlbum> getSongAlbum(int songId) {
        return mNetRetrofitService.getSongAlbum(songId);
    }

    @Override
    public Observable<Banner> getBanner() {
        return mNetRetrofitService.getBanner();
    }

    @Override
    public Observable<RecommendSongList> getRecommendSongList(int limit) {
        return mNetRetrofitService.getRecommendSongList(limit);
    }

    @Override
    public Observable<SongListDetail> getPlayListDetail(long songListId) {
        return mNetRetrofitService.getPlayListDetail(songListId);
    }

    @Override
    public Observable<SongDetail> getSongDetail(String ids) {
        return mNetRetrofitService.getSongDetail(ids);
    }
}
